package com.soxing.braindata.common.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


//这四个编码映射受试者管理系统同步过来的rolepkid
@Data
@Configuration
@ConfigurationProperties(prefix = "role")
public class RoleConfig {

    private String collectRoleCode;

    private String siteRoleCode;

    private String researchRoleCode;

    private String platformRoleCode;

    public String getRoleName(String code)
    {
        if(code.equals(collectRoleCode))
        {
            return "数据采集员";
        }
        if(code.equals(siteRoleCode))
        {
            return "分中心管理员";
        }
        if(code.equals(researchRoleCode))
        {
            return "课题管理员";
        }
        if(code.equals(platformRoleCode))
        {
            return "平台管理员";
        }
        return "未分配权限";

    }

}
